﻿#region License
/* ---------------------------------------------------------------- *
 *
 * This file is part of the Xcoordination Application Space
 * ("XcoAppSpace") http://www.xcoordination.com
 *
 * Copyright (C) 2009 Xcoordination http://www.xcoordination.com
 *
 * XcoAppSpace is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General
 * Public License as published by the Free Software Foundation.
 *
 * XcoAppSpace is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/
 * or write to the Free Software Foundation, Inc., 51 Franklin
 * Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * ---------------------------------------------------------------- */
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XcoAppSpaces.Security.Basic
{
	/// <summary>
	/// Represents a users within the XcoBasicSecurityService.
	/// </summary>
	public class User
	{
		/// <summary>
		/// The name of the user.
		/// </summary>
		public string Name { get; set; }

		/// <summary>
		/// The (encrypted) password of the user.
		/// </summary>
		public byte[] Password { get; set; }

		/// <summary>
		/// List of the user's roles.
		/// </summary>
		public List<string> Roles { get; set; }

		/// <summary>
		/// Creates a new User.
		/// </summary>
		public User()
		{
		}

		/// <summary>
		/// Creates a new User.
		/// </summary>
		/// <param name="name">The name of the user.</param>
		/// <param name="password">The (encrypted) password of the user.</param>
		/// <param name="roles">List of the user's roles.</param>
		public User(string name, byte[] password, params string[] roles)
		{
			this.Name = name;
			this.Password = password;
			this.Roles = new List<string>();
			this.Roles.AddRange(roles);
		}
	}
}
